﻿using System.Text;
using System.Text.Encodings.Web;
using System.Text.Json;
using System.Text.Json.Serialization;
using System.Text.Unicode;

namespace NiuX.Json;

public class JsonSerializerOptionsInstance
{
    public static JsonSerializerOptions IgnoreNullAndCamelCaseAndIndented = new JsonSerializerOptions
    {
        PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
        DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull,
        WriteIndented = true,
        //Encoder = JavaScriptEncoder.Create(UnicodeRanges.All)
    };

    public static JsonSerializerOptions UnicodeRangesAllEncoder = new JsonSerializerOptions
    {
        Encoder = JavaScriptEncoder.Create(UnicodeRanges.All)
    };
    public static JsonSerializerOptions UnsafeRelaxedJsonEscapingEncoder = new JsonSerializerOptions
    {
        Encoder =  JavaScriptEncoder.UnsafeRelaxedJsonEscaping
    };
}